Skip to content

Greasemonkey environment is missing cloneInto, createObjectIn and exportFunction #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KarlCastle opened this issue Jan 21, 2019 · 0 comments

Comments

@KarlCastle
Copy link
Contributor

Greasemonkey 2.0 added these three functions to the userscript scope in response to https://blog.mozilla.org/addons/2014/04/10/changes-to-unsafewindow-for-the-add-on-sdk/

Greasespot blog on the topic: https://www.greasespot.net/2014/06/greasemonkey-20-release.html

Tampermonkey added the same functions for cross-compatibility around the same time? I can't find the changelog and, due to the different structure internally, these functions aren't required for userscripts in Tampermonkey.

As of Greasemonkey 4.7 all three functions are still in the global namespace and not using them generates Error: Permission denied to access object errors in Firefox 64.

Recommendation from Greasemonkey to continue using cloneInto() and exportFunction() post-GM4: https://www.greasespot.net/2017/09/greasemonkey-4-for-script-authors.html

Documentation from Mozilla, updated in September 2018: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts#Sharing_content_script_objects_with_page_scripts

I'll put together a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant